﻿<internals:PageBase
    x:Class="JV.Com.Views.FolderPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:JV.Com.Views"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    xmlns:internals="using:JV.Com.Internals"
    xmlns:prism="using:Microsoft.Practices.Prism.StoreApps"
    prism:ViewModelLocator.AutoWireViewModel="true">

    <Grid>
        <Grid.Transitions>
            <TransitionCollection>
                <ContentThemeTransition />
            </TransitionCollection>
        </Grid.Transitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="140" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>

        <Border BorderBrush="{StaticResource DataItemBorderThemeBrush}" VerticalAlignment="Top" Margin="20, 0, 20, 20" MaxWidth="1500"  Grid.Row="1"
                    Background="White" BorderThickness="1" Visibility="{Binding InLoading, Converter={StaticResource IB2VConverter}}">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>

                <Border BorderThickness="0, 0, 0, 1" BorderBrush="{StaticResource DataItemBorderThemeBrush}">
                    <Grid Margin="20, 20, 20, -10">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>

                        <StackPanel Orientation="Horizontal" Visibility="{Binding CanGoPrevPage, Converter={StaticResource B2VConverter}}">
                            <AppBarButton Command="{Binding GoPrevPageCommand}" Icon="Back" IsCompact="True" Margin="0, -6, 0, 0">
                                <AppBarButton.RenderTransform>
                                    <ScaleTransform ScaleX="0.8" ScaleY="0.8" />
                                </AppBarButton.RenderTransform>
                            </AppBarButton>
                            <TextBlock Text="Page précédente" Style="{StaticResource SubheaderTextBlockStyle}" IsHitTestVisible="false" />
                        </StackPanel>
                        <StackPanel Orientation="Horizontal" Grid.Column="1" Margin="20, 0, 0, 0"
                                    Visibility="{Binding CanGoPrevPage, Converter={StaticResource B2VConverter}}">
                            <AppBarButton Command="{Binding GoSummaryCommand}" Icon="Preview" IsCompact="True" Margin="0, -6, 0, 0">
                                <AppBarButton.RenderTransform>
                                    <ScaleTransform ScaleX="0.8" ScaleY="0.8" />
                                </AppBarButton.RenderTransform>
                            </AppBarButton>
                            <TextBlock Text="Sommaire" Style="{StaticResource SubheaderTextBlockStyle}" IsHitTestVisible="false" />
                        </StackPanel>
                        <StackPanel Orientation="Horizontal" Grid.Column="2" Margin="0, 0, -12, 0"
                                    Visibility="{Binding CanGoNextPage, Converter={StaticResource B2VConverter}}">
                            <TextBlock Text="Page suivante" Style="{StaticResource SubheaderTextBlockStyle}" IsHitTestVisible="false" />
                            <AppBarButton Command="{Binding GoNextPageCommand}" Icon="Forward" IsCompact="True" Margin="12, -6, 0, 0">
                                <AppBarButton.RenderTransform>
                                    <ScaleTransform ScaleX="0.8" ScaleY="0.8" />
                                </AppBarButton.RenderTransform>
                            </AppBarButton>
                        </StackPanel>
                    </Grid>
                </Border>
                
                <Grid Grid.Row="1">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="3*" />
                        <ColumnDefinition Width="7*" />
                    </Grid.ColumnDefinitions>
                    <StackPanel Orientation="Vertical" Margin="20, 20, 0, 20">
                        <Image Source="{Binding SmallImageUrl}" Stretch="Uniform" VerticalAlignment="Top" Margin="0, 0, 0, 10" />
                        <TextBlock Text="{Binding SummaryPage}" Style="{StaticResource SummaryItemTextBlockStyle}" />
                    </StackPanel>
                    <Frame x:Name="FolderFrame" Grid.Column="1" />
                </Grid>
                
            </Grid>
        </Border>

        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="120"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <Button  x:Name="backButton" Style="{StaticResource NavigationBackButtonNormalStyle}"
                                 Margin="39,59,39,0" VerticalAlignment="Top"
                                 Command="{Binding GoBackCommand}"
                                 AutomationProperties.Name="Back"
                                 AutomationProperties.AutomationId="BackButton"
                                 AutomationProperties.ItemType="Navigation Button"/>
            <TextBlock x:Name="pageTitle" Text="{Binding PageTitle}" Style="{StaticResource HeaderTextBlockStyle}" Grid.Column="1"
                                VerticalAlignment="Bottom" Margin="0,0,30,40" IsHitTestVisible="false" TextWrapping="NoWrap" />
            <SearchBox Grid.Column="2"
                                Height="35" Width="270" VerticalAlignment="Top"
                                PlaceholderText="Rechercher" QueryText="{Binding Query}"
                                SuggestionsRequested="SearchBox_SuggestionsRequested"
                                QuerySubmitted="SearchBox_QuerySubmitted" Margin="0, 63, 40, 0" />
        </Grid>
    </Grid>
</internals:PageBase>
